/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rdb.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Bich Tran Van
 */
@Entity
@Table(name = "Registers")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Registers.findAll", query = "SELECT r FROM Registers r"),
    @NamedQuery(name = "Registers.findByReId", query = "SELECT r FROM Registers r WHERE r.reId = :reId"),
    @NamedQuery(name = "Registers.findByCreateDate", query = "SELECT r FROM Registers r WHERE r.createDate = :createDate"),
    @NamedQuery(name = "Registers.findByStatus", query = "SELECT r FROM Registers r WHERE r.status = :status")})
public class Registers implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "reId")
    private Integer reId;
    @Column(name = "CreateDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createDate;
    @Column(name = "status")
    private Boolean status;
    @JoinColumn(name = "assignFac", referencedColumnName = "user_id")
    @ManyToOne
    private Users assignFac;
    @JoinColumn(name = "Id", referencedColumnName = "Id")
    @ManyToOne
    private StudentExams id;
    

    public Registers() {
    }

    public Registers(Integer reId) {
        this.reId = reId;
    }

    public Integer getReId() {
        return reId;
    }

    public void setReId(Integer reId) {
        this.reId = reId;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public Users getAssignFac() {
        return assignFac;
    }

    public void setAssignFac(Users assignFac) {
        this.assignFac = assignFac;
    }

    public StudentExams getId() {
        return id;
    }

    public void setId(StudentExams id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (reId != null ? reId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Registers)) {
            return false;
        }
        Registers other = (Registers) object;
        if ((this.reId == null && other.reId != null) || (this.reId != null && !this.reId.equals(other.reId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.rdb.entities.Registers[ reId=" + reId + " ]";
    }
    
}
